package cn.edu.css.sai;

import com.dgut.autoconfig.MailSendEvent;
import com.dgut.autoconfig.MailSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

import java.util.Objects;

@SpringBootApplication
public class App {
    public  static void main(String []args){
        SpringApplication.run(App.class,args);
    }
    //@Component
    @EnableAutoConfiguration
    static class LocalCommandLineRunner implements CommandLineRunner {
        Environment env;
        public LocalCommandLineRunner(Environment env)
        {
            this.env=env;
        }

        @Override

        public void run(String... args){

            System.out.println(">>>缺少注解EnableAutoConfiguration<<<\n"+">>>This is the Local CommandLineRunner!<<<");
            System.out.println(">>>生成一个随机字符串:".concat((Objects.requireNonNull(env.getProperty("random.")))));

        }

    }
}
